from sqlalchemy import Boolean, Column, ForeignKey, Integer, String
from sqlalchemy.orm import relationship
from uuid import UUID, uuid4
from datetime import datetime
from models.base import Base


class FlowRelation(Base):
    '''
    流程关联的插件，秘钥等，删除秘钥、插件得先在这里查询一下是否有流程还在关联
    '''
    __tablename__ = "flow_relations"

    id: UUID = Column(primary_key=True, unique=True)
    main_id: UUID = Column(ForeignKey("flow_relations.id"), nullable=False)
    target_id: UUID = Column(ForeignKey("flow_relations.id"), nullable=False)
    relation_type: str = Column(String, nullable=False)

